﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Xml.Linq;

namespace ConsoleApplication1
{
    class Program
    {
        private static void Main()
        {
            string crap = Console.ReadLine(); 
            crap = null;

            int n = int.Parse(Console.ReadLine());

            string[] places = new string[] { "държава", "град", "континент", "полуостров", "село", "гора", "пещера", "местност", "улица", "булевард", "площад", "планета", "район", "ханство" };
            bool isPlace = false;
            string[] persons = new string[] { "владетел", "цар", "политик", "учен", "физик", "математик", "историк", "писател", "художник", "химик", "програмист", "княз", "хан", "философ" }; // dano da nqma jeni
            bool isPerson = false;
            for (int i = 0; i < n; i++)
            {
                //Thread.CurrentThread.CurrentCulture = new CultureInfo("bg-BG");
                string input = Console.ReadLine().Trim();

                if (input[0] >= 1040 && input[0] <= 1071)
                {
                    //Console.WriteLine((int)'А'); // 1040
                    //Console.WriteLine((int)'Я'); // 1071
                    string[] asdf = input.Split();


                    string url = "http://bg.wikipedia.org/wiki/" + string.Join("_", asdf);
                    string fdsa = XDocument.Load(url).ToString();
                    //string fdsa = File.ReadAllText(@"C:\Users\Georgi\Desktop\www.txt");
                    string final = fdsa.Substring(fdsa.IndexOf("<p") - 100, fdsa.IndexOf("</p") - fdsa.IndexOf("<p") - 100 + 1);

                    string[] finalWords = final.Split(new char[] { '.', ',', '<', '>', ')', '(', '/', '\\', '\t', ' ' }, StringSplitOptions.RemoveEmptyEntries);
                    
                    foreach (var word in finalWords)
                    {
                        foreach (var place in places)
                        {
                            if (place.Equals(word))
                            {
                                isPlace = true;
                                break;
                            }
                        }
                        if (isPlace)
                        {
                            break;
                        }

                        foreach (var person in persons)
                        {
                            if (person.Equals(word))
                            {
                                isPerson = true;
                            }
                            break;
                        }
                        if (isPerson)
                        {
                            break;
                        }
                    }

                    if (isPlace)
                    {
                        Console.WriteLine("Place");
                    }
                    else if (isPerson)
                    {
                        Console.WriteLine("Person");
                    }
                    else
                    {
                        Console.WriteLine("Unknown");
                    }


                    // edin string ot indexof <p  do  indeof </p(po4vaiki ot indexa na <p)
                    // splitvane na stringa po whitespaces
                    // proverqvane na vsqka duma ot stringa.ToLower() dali suvpada s nqkoq duma sus zna4enie "pestopolojenie"
                    // ako e pestopolojenie bool isPlace = true; break; Console.WriteLine("Place");
                    // ako ne e pestopolojenie Console.WriteLine("Person");



                    //using (WebClient client = new WebClient())
                    //{
                    //    string s = client.DownloadString(url);
                    //    //fdsa = Uri.UnescapeDataString(s);
                    //    //fdsa = Encoding.UTF8.GetString(s.ToCharArray());
                    //}
                }
                else
                {
                    Console.WriteLine("Unknown");
                }
            }
        }
    }
}
